﻿namespace KMSimulator.Model
{
    public abstract class KMActionBase
    {
        /// <summary>
        /// 动作ID
        /// </summary>
        public string Id { get; set; } = Guid.NewGuid().ToString();

        /// <summary>
        /// 动作名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 分组
        /// </summary>
        public string Group { get; set; } = string.Empty;

        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; } = string.Empty;

        /// <summary>
        /// 排序索引号
        /// </summary>
        public int Index { get; set; }

        /// <summary>
        /// 动作类型
        /// </summary>
        public abstract KMActionType ActionType { get; }

        /// <summary>
        /// 释放时间
        /// </summary>
        public int ReleaseTime { get; set; } = 100;

        /// <summary>
        /// 执行模式
        /// </summary>
        public ExecuteMode Mode { get; set; }

        /// <summary>
        /// 动作执行次数或时长
        /// </summary>
        public int ExecuteCount { get; set; } = 1;

        /// <summary>
        /// 多次间隔时间
        /// </summary>
        public int Interval { get; set; } = 100;

        /// <summary>
        /// 延时
        /// </summary>
        public int Delay { get; set; } = 100;

        /// <summary>
        /// 输出参数文本
        /// </summary>
        /// <returns></returns>
        public abstract override string ToString();

        /// <summary>
        /// 获取动作类型名称
        /// </summary>
        /// <returns></returns>
        public abstract string GetActionType();
    }
}
